<!-- 013min.vue -->
<template>
    <div class="min3-app" :class="{'dark-mode': darkMode}">
      <header class="app-header">
        <h1>✨ 3分钟理解复杂概念</h1>
        <button @click="toggleDarkMode" class="dark-mode-toggle">
          {{ darkMode ? '☀️' : '🌙' }}
        </button>
      </header>
      
      <div class="concept-selector card">
        <div class="search-box">
          <input 
            v-model="searchQuery" 
            placeholder="搜索复杂概念..." 
            @input="debouncedFilterConcepts"
            :disabled="isInputDisabled"
          >
          <span class="search-icon">🔍</span>
        </div>
        
        <div class="concept-grid">
          <div 
            v-for="concept in filteredConcepts" 
            :key="concept.id"
            class="concept-card"
            :class="{'selected': selectedConcept === concept.id}"
            @click="selectConcept(concept.id)"
          >
            <div class="concept-icon">{{ concept.emoji }}</div>
            <h3>{{ concept.name }}</h3>
          </div>
        </div>
      </div>
      
      <transition name="fade">
        <div v-if="currentConcept" class="concept-explanation card">
          <div class="explanation-header">
            <h2>{{ currentConcept.name }}</h2>
            <div class="difficulty">
              难度: 
              <span 
                v-for="star in 5" 
                :key="star" 
                :class="{'active': star <= currentConcept.difficulty}"
              >★</span>
            </div>
          </div>
          
          <div class="analogy-section">
            <h3>生活比喻</h3>
            <p>{{ currentConcept.analogy }}</p>
            <div class="visual-aid" :style="{backgroundImage: `url(${currentConcept.image})`}"></div>
          </div>
          
          <div class="key-points">
            <h3>核心要点 <span class="points-count">{{ currentConcept.keyPoints.length }}个</span></h3>
            <ul>
              <li v-for="(point, index) in currentConcept.keyPoints" :key="index">
                <span class="point-number">{{ index + 1 }}</span>
                {{ point }}
              </li>
            </ul>
          </div>
          
          <div class="timer-section">
            <div class="timer-display" :class="{'warning': timeLeft <= 30}">
              {{ minutes }}:{{ seconds.toString().padStart(2, '0') }}
            </div>
            <div class="progress-bar">
              <div 
                class="progress" 
                :style="{width: `${(timeLeft / 180) * 100}%`}"
              ></div>
            </div>
            <button 
              @click="startTimer" 
              class="timer-button"
              :disabled="timerRunning"
            >
              {{ timerRunning ? '理解中...' : '开始3分钟理解' }}
            </button>
          </div>
          
          <div class="action-buttons">
            <button @click="showQuiz = true" class="quiz-button">测试理解</button>
            <button @click="shareConcept" class="share-button">分享</button>
          </div>
        </div>
      </transition>
      
      <transition name="modal">
        <div v-if="showQuiz" class="quiz-modal">
          <div class="quiz-content">
            <h3>测试你对{{ currentConcept.name }}的理解</h3>
            <div class="quiz-question" v-if="currentQuizQuestion">
              <p>{{ currentQuizQuestion.question }}</p>
              <div class="quiz-options">
                <button 
                  v-for="(option, index) in currentQuizQuestion.options" 
                  :key="index"
                  @click="checkAnswer(option.correct)"
                  :class="{'selected': selectedAnswer === index}"
                >
                  {{ option.text }}
                </button>
              </div>
            </div>
            <div class="quiz-feedback" v-if="quizFeedback">
              {{ quizFeedback }}
            </div>
            <button @click="showQuiz = false" class="close-quiz">关闭</button>
          </div>
        </div>
      </transition>
      <MaskLayer :visible="showMask" :showClose="false">
        <h3>加载中</h3>
      </MaskLayer>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  import MaskLayer from '@/components/MaskLayer.vue';

  export default {
    name: 'Min3App',
    components: { MaskLayer },
    data() {
      return {
        showMask: false, // 控制遮罩层的显示,
        isInputDisabled: false,
        selectedConcept: '',
        searchQuery: '',
        filteredConcepts: [],
        timer: null,
        timeLeft: 180,
        timerRunning: false,
        darkMode: false,
        showQuiz: false,
        currentQuizQuestion: null,
        selectedAnswer: null,
        quizFeedback: '',
        concepts: [
          {
            id: 'quantum',
            name: '量子力学',
            emoji: '🔮',
            difficulty: 5,
            analogy: '就像在黑暗房间里找一只猫，在你开灯前，猫既是活的也是死的，就像量子叠加态',
            image: 'https://images.unsplash.com/photo-1635070041078-e363dbe005cb?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80',
            keyPoints: [
              '微观粒子可以同时处于多种状态',
              '观测行为会影响被观测对象',
              '量子纠缠:两个粒子无论多远都能瞬间影响彼此'
            ],
            quiz: [
              {
                question: '量子叠加态是什么意思?',
                options: [
                  { text: '粒子可以同时处于多个状态', correct: true },
                  { text: '粒子会叠加在一起', correct: false },
                  { text: '量子比原子大', correct: false }
                ]
              }
            ]
          },
          {
            id: 'blockchain',
            name: '区块链',
            emoji: '⛓️',
            difficulty: 4,
            analogy: '就像全班同学共同记账，每个人都有一个账本，要改账必须全班同意',
            image: 'https://images.unsplash.com/photo-1621761191319-c6fb62004040?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80',
            keyPoints: [
              '去中心化的分布式账本',
              '数据以区块形式链接，难以篡改',
              '通过共识机制验证交易'
            ],
            quiz: [
              {
                question: '区块链的主要特点是什么?',
                options: [
                  { text: '中心化控制', correct: false },
                  { text: '去中心化和不可篡改', correct: true },
                  { text: '速度非常快', correct: false }
                ]
              }
            ]
          },
          {
            id: 'relativity',
            name: '相对论',
            emoji: '⏱️',
            difficulty: 5,
            analogy: '就像在行驶的火车上打球，车上的人觉得球直上直下，车外的人看到的是抛物线',
            image: 'https://images.unsplash.com/photo-1534447677768-be436bb09401?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80',
            keyPoints: [
              '时间流逝速度取决于观察者的运动状态',
              '质量会弯曲时空，产生引力',
              '光速是宇宙速度极限'
            ],
            quiz: [
              {
                question: '相对论的核心观点是什么?',
                options: [
                  { text: '时间和空间是绝对的', correct: false },
                  { text: '时间和空间是相对的', correct: true },
                  { text: '重力不存在', correct: false }
                ]
              }
            ]
          },
          {
  "id": "neural-network",
  "name": "神经网络",
  "emoji": "🧠",
  "difficulty": 4,
  "analogy": "就像邮局的分拣系统，初级员工先粗略分类（输入层），经验丰富的员工逐步细化（隐藏层），最后由主管确认最终目的地（输出层）",
  "image": "https://images.unsplash.com/photo-1628498188885-274bb378e58f?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80",
  "keyPoints": [
    "模仿人脑神经元连接方式",
    "通过反向传播自动调整参数",
    "深度网络能提取多层次特征"
  ],
  "quiz": [
    {
      "question": "神经网络通过什么机制学习？",
      "options": [
        { "text": "不断试错并调整神经元连接强度", "correct": true },
        { "text": "直接复制人类大脑结构", "correct": false },
        { "text": "随机生成答案直到正确", "correct": false }
      ]
    }
  ]
},{
  "id": "dark-matter",
  "name": "暗物质",
  "emoji": "🌑",
  "difficulty": 5,
  "analogy": "就像剧场里看不见的舞台工作人员，虽然看不到他们，但通过演员（可见星系）不自然的移动速度，能推断他们的存在",
  "image": "https://images.unsplash.com/photo-1462331940025-496dfbfc7564?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80",
  "keyPoints": [
    "不发光不反射光，只能通过引力效应观测",
    "占宇宙总质能的27%，是普通物质的5倍",
    "可能由弱相互作用大质量粒子（WIMP）构成"
  ],
  "quiz": [
    {
      "question": "科学家如何探测暗物质？",
      "options": [
        { "text": "通过望远镜直接拍摄", "correct": false },
        { "text": "观测其对可见物质的引力影响", "correct": true },
        { "text": "用雷达反射信号测量", "correct": false }
      ]
    }
  ]
},{
  "id": "wormhole",
  "name": "虫洞",
  "emoji": "🕳️",
  "difficulty": 5,
  "analogy": "如同苹果上的蛀虫通道，三维世界的两点通过四维空间捷径连接，就像蚂蚁在苹果表面爬行需要绕半圈，而蛀虫直接穿过内部",
  "image": "https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80",
  "keyPoints": [
    "时空拓扑结构中的捷径隧道",
    "需要负能量物质维持稳定",
    "可能产生时间旅行悖论"
  ],
  "quiz": [
    {
      "question": "虫洞理论属于哪个物理领域？",
      "options": [
        { "text": "经典力学", "correct": false },
        { "text": "广义相对论", "correct": true },
        { "text": "电磁学", "correct": false }
      ]
    }
  ]
}
        ],
        isMobile: false
      }
    },
    created() {
      this.filteredConcepts = [...this.concepts]
      this.checkIfMobile()
      window.addEventListener('resize', this.checkIfMobile)
      
      // 检测用户偏好颜色模式
      if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
        this.darkMode = true
      }
      // 添加注释
      // 创建一个防抖动版本的filterConcepts函数
      // 当用户连续输入时,延迟1000毫秒后才执行一次过滤操作
      // 这样可以避免频繁调用filterConcepts造成性能问题
      this.debouncedFilterConcepts = this.debounce(this.filterConcepts, 1000);    
    }, 
    beforeUnmount() {
      window.removeEventListener('resize', this.checkIfMobile)
      if (this.timer) clearInterval(this.timer)
    },
    computed: {
      currentConcept() {
        return this.concepts.find(c => c.id === this.selectedConcept) || null
      },
      minutes() {
        return Math.floor(this.timeLeft / 60)
      },
      seconds() {
        return this.timeLeft % 60
      }
    },
    methods: {
      checkIfMobile() {
        this.isMobile = window.innerWidth <= 768
      },
      selectConcept(id) {
        console.log(id)
        this.selectedConcept = id
        this.resetTimer()
        console.log(this.currentConcept)
        console.log(this.currentConcept.quiz)
        if (this.currentConcept && this.currentConcept.quiz) {
          this.currentQuizQuestion = this.currentConcept.quiz[0]
        }
      },
      // 输入按钮防抖动功能
      debounce(fn, delay) {
        let timer = null
        return function() {
          if (timer) {
            clearTimeout(timer)
          }
          timer = setTimeout(() => {
            fn.apply(this, arguments)
          }, delay)
        }
      },
      filterConcepts() {
        if (!this.searchQuery) {
          this.filteredConcepts = [...this.concepts]
          return
        }
        const query = this.searchQuery.toLowerCase()
        this.filteredConcepts = this.concepts.filter(concept => 
          concept.name.toLowerCase().includes(query) || 
          concept.analogy.toLowerCase().includes(query)
        )
        if (this.filteredConcepts.length === 0) {
          this.fetchConceptExplanation(query)
        }
      },
      startTimer() {
        if (this.timer) clearInterval(this.timer)
        this.timeLeft = 180
        this.timerRunning = true
        
        this.timer = setInterval(() => {
          this.timeLeft--
          if (this.timeLeft <= 0) {
            clearInterval(this.timer)
            this.timerRunning = false
            this.showCompletion()
          }
        }, 1000)
      },
      resetTimer() {
        if (this.timer) clearInterval(this.timer)
        this.timeLeft = 180
        this.timerRunning = false
      },
      showCompletion() {
        alert(`时间到！你应该已经理解了${this.currentConcept.name}的基础概念！`)
      },
      toggleDarkMode() {
        this.darkMode = !this.darkMode
      },
      checkAnswer(correct) {
        if (correct) {
          this.quizFeedback = '✅ 回答正确！看来你已经掌握了这个概念！'
        } else {
          this.quizFeedback = '❌ 不太准确，再回顾一下上面的解释吧！'
        }
      },
      shareConcept() {
        if (navigator.share) {
          navigator.share({
            title: `我刚刚用3分钟理解了${this.currentConcept.name}`,
            text: `"${this.currentConcept.analogy}" - 点击了解更多复杂概念的简单解释`,
            url: window.location.href
          }).catch(err => {
            console.log('分享失败:', err)
          })
        } else {
          // 备用分享方式
          alert('分享功能在您的设备上不可用，请手动复制链接')
        }
      },
      async fetchConceptExplanation(concept) {
        try {
          this.showMask = true; // 开始请求时显示遮罩
          this.isInputDisabled = true; // 禁用输入框
          const response = await axios.post(`/api/concept`, {
            concept: concept,
            difficulty: 'beginner'
          });
          console.log(response.data);
          console.log(this.concepts);
          let res = response.data;
          if (Object.keys(res).length === 0) {
            alert('生成失败');
          } else {
            this.$set(this.concepts, this.concepts.length, response.data);
            console.log(this.concepts);
            this.filteredConcepts = [];
            this.filteredConcepts.push(response.data);
            this.selectedConcept = res.id;
            this.selectConcept(res.id);
          }
        } catch (error) {
          alert('调用后端接口失败，请稍后重试');
          console.error('Error fetching concept explanation:', error);
          this.filteredConcepts = [];
          this.selectedConcept = '';
        } finally {
          this.showMask = false; // 请求结束后隐藏遮罩
          this.isInputDisabled = false; // 启用输入框
        }
      }
    }
  }
  </script>
  
  <style scoped>
  /* 基础样式 */
  .min3-app {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
    transition: all 0.3s ease;
    min-height: 100vh;
    box-sizing: border-box;
  }
  
  .min3-app.dark-mode {
    background-color: #1a1a1a;
    color: #f0f0f0;
  }
  
  /* 头部样式 */
  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .dark-mode .app-header {
    border-bottom-color: #444;
  }
  
  h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #4a6baf;
    font-weight: 600;
  }
  
  .dark-mode h1 {
    color: #6d8ae2;
  }
  
  .dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
  }
  
  /* 卡片样式 */
  .card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
  }
  
  .dark-mode .card {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* 搜索框 */
  .search-box {
    position: relative;
    margin-bottom: 15px;
  }
  
  .search-box input {
    width: 100%;
    padding: 10px 15px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-sizing: border-box;
  }
  
  .dark-mode .search-box input {
    background: #3d3d3d;
    border-color: #555;
    color: #f0f0f0;
  }
  
  .search-box input:focus {
    outline: none;
    border-color: #4a6baf;
    box-shadow: 0 0 0 2px rgba(74, 107, 175, 0.2);
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
  }
  
  /* 概念网格 */
  .concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  @media (max-width: 480px) {
    .concept-grid {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
  }
  
  .concept-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .dark-mode .concept-card {
    background: #3d3d3d;
  }
  
  .concept-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  }
  
  .concept-card.selected {
    border-color: #4a6baf;
    background: #e6ecff;
  }
  
  .dark-mode .concept-card.selected {
    border-color: #6d8ae2;
    background: #3a4a6e;
  }
  
  .concept-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }
  
  .concept-card h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
  }
  
  /* 概念解释区域 */
  .explanation-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
  }
  
  .explanation-header h2 {
    margin: 0 0 8px 0;
    color: #4a6baf;
    font-size: 1.3rem;
  }
  
  .dark-mode .explanation-header h2 {
    color: #6d8ae2;
  }
  
  .difficulty {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
  }
  
  .difficulty span {
    color: #ccc;
    margin-right: 3px;
    font-size: 0.9rem;
  }
  
  .difficulty span.active {
    color: #ffc107;
  }
  
  .analogy-section h3,
  .key-points h3 {
    color: #4a6baf;
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 10px;
  }
  
  .dark-mode .analogy-section h3,
  .dark-mode .key-points h3 {
    color: #6d8ae2;
  }
  
  .analogy-section p {
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 15px;
  }
  
  .visual-aid {
    height: 160px;
    background-size: cover;
    background-position: center;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
  }
  
  .dark-mode .visual-aid {
    border-color: #555;
  }
  
  /* 核心要点 */
  .key-points ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
  }
  
  .key-points li {
    padding: 10px;
    margin-bottom: 8px;
    background: #f0f4ff;
    border-radius: 6px;
    position: relative;
    padding-left: 40px;
    line-height: 1.5;
    font-size: 0.9rem;
  }
  
  .dark-mode .key-points li {
    background: #3a4a6e;
  }
  
  .point-number {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #4a6baf;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
  }
  
  .dark-mode .point-number {
    background: #6d8ae2;
  }
  
  .points-count {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
  }
  
  .dark-mode .points-count {
    color: #aaa;
  }
  
  /* 计时器部分 */
  .timer-section {
    margin-top: 20px;
    text-align: center;
  }
  
  .timer-display {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a6baf;
  }
  
  .dark-mode .timer-display {
    color: #6d8ae2;
  }
  
  .timer-display.warning {
    color: #e74c3c;
    animation: pulse 1s infinite;
  }
  
  @keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
  }
  
  .progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
  }
  
  .dark-mode .progress-bar {
    background: #444;
  }
  
  .progress {
    height: 100%;
    background: linear-gradient(90deg, #4a6baf, #6d8ae2);
    transition: width 1s linear;
  }
  
  .timer-button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #4a6baf, #6d8ae2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(74, 107, 175, 0.3);
    width: 100%;
    max-width: 200px;
  }
  
  .timer-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 107, 175, 0.4);
  }
  
  .timer-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }
  
  /* 操作按钮 */
  .action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    gap: 10px;
  }
  
  .quiz-button,
  .share-button {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    flex: 1;
  }
  
  .quiz-button {
    background: #f0f4ff;
    color: #4a6baf;
  }
  
  .dark-mode .quiz-button {
    background: #3a4a6e;
    color: #b8c6ff;
  }
  
  .share-button {
    background: #e8f5e9;
    color: #2e7d32;
  }
  
  .dark-mode .share-button {
    background: #2d4a2e;
    color: #a5d6a7;
  }
  
  .quiz-button:hover,
  .share-button:hover {
    transform: translateY(-2px);
  }
  
  /* 测试模态框 */
  .quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
  }
  
  .quiz-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  
  .dark-mode .quiz-content {
    background: #2d2d2d;
  }
  
  .quiz-question {
    margin-bottom: 15px;
  }
  
  .quiz-question p {
    font-size: 0.95rem;
    margin-bottom: 15px;
  }
  
  .quiz-options {
    display: grid;
    gap: 8px;
  }
  
  .quiz-options button {
    padding: 10px;
    background: #f0f4ff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
  }
  
  .dark-mode .quiz-options button {
    background: #3a4a6e;
    border-color: #555;
  }
  
  .quiz-options button:hover {
    background: #e0e8ff;
  }
  
  .dark-mode .quiz-options button:hover {
    background: #4a5a7e;
  }
  
  .quiz-options button.selected {
    background: #4a6baf;
    color: white;
    border-color: #4a6baf;
  }
  
  .dark-mode .quiz-options button.selected {
    background: #6d8ae2;
    border-color: #6d8ae2;
  }
  
  .quiz-feedback {
    margin: 10px 0;
    padding: 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
  }
  
  .close-quiz {
    padding: 8px 16px;
    background: #4a6baf;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    width: 100%;
  }
  
  .dark-mode .close-quiz {
    background: #6d8ae2;
  }
  
  /* 过渡动画 */
  .fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s;
  }
  .fade-enter, .fade-leave-to {
    opacity: 0;
  }
  
  .modal-enter-active, .modal-leave-active {
    transition: opacity 0.3s;
  }
  .modal-enter, .modal-leave-to {
    opacity: 0;
  }
  
  /* 移动端特定样式 */
  @media (max-width: 768px) {
    .min3-app {
      padding: 10px;
    }
    
    h1 {
      font-size: 1.3rem;
    }
    
    .concept-grid {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .concept-card {
      padding: 10px;
      min-height: 70px;
    }
    
    .concept-icon {
      font-size: 1.2rem;
    }
    
    .concept-card h3 {
      font-size: 0.8rem;
    }
    
    .visual-aid {
      height: 120px;
    }
    
    .timer-display {
      font-size: 1.8rem;
    }
    
    .timer-button {
      padding: 10px 20px;
      font-size: 0.9rem;
    }
  }
  
  @media (max-width: 480px) {
    .min3-app {
      padding: 8px;
    }
    
    h1 {
      font-size: 1.2rem;
    }
    
    .concept-grid {
      grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
      gap: 8px;
    }
    
    .concept-card {
      padding: 8px;
      min-height: 60px;
    }
    
    .concept-icon {
      font-size: 1rem;
      margin-bottom: 5px;
    }
    
    .concept-card h3 {
      font-size: 0.7rem;
    }
    
    .visual-aid {
      height: 100px;
    }
    
    .timer-display {
      font-size: 1.5rem;
    }
    
    .action-buttons {
      flex-direction: column;
      gap: 8px;
    }
    
    .quiz-button,
    .share-button {
      width: 100%;
    }
  }
  </style>

/* 添加遮罩样式 */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}